﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Flagwind.Options
{
	internal static class OptionUtility
	{
		internal static void ResolveOptionPath(string fullPath, out string path, out string name)
		{
			path = string.Empty;
			name = string.Empty;

			if(string.IsNullOrWhiteSpace(fullPath))
				throw new ArgumentNullException(nameof(fullPath));

			var index = fullPath.LastIndexOf('/');

			if(index >= 0)
				path = fullPath.Substring(0, Math.Max(1, index));

			name = fullPath.Substring(index + 1);
		}
	}
}